<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      >
<head th:replace="admin/common/html/tableHead :: tableHead(~{::title},~{::link},~{::style})">

<title th:text=${title}></title>
<!-- 这儿引用单独的css link -->
<!-- Ladda for Bootstrap 3按钮加载进度插件 -->
<link rel="stylesheet" th:href="@{/static/admin/assets/js/button/ladda/ladda.min.css}">
<!-- bootstrap-table表单样式 -->
<link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
<!-- 用户界面自定义css -->
<link th:href="@{/static/admin/common/css/common-add.css}" rel="stylesheet"/>
<!-- checkbox css-->
<link href="/static/admin/assets/css/Checkboxes/awesome-bootstrap-checkbox.css" rel="stylesheet"/>
<style type="text/css"></style>
</head>

<body>

<div class="content-wrap">
	<div class="row">
		<div class="col-sm-12">
			<div class="nest" id="elementClose">
                <div class="title-alt">
                    <h6>新增app</h6>
                    <div class="titleToggle">
                        <a class="nav-toggle-alt" href="#element">
                            <span class="entypo-up-open"></span>
                        </a>
                    </div>
                </div>
				
				<div class="body-nest" id="element">
					<div class="panel-body">
						<form  class="form-horizontal m" id="form-add">
							<div class="form-group">
								<label class="col-sm-4 control-label ">app名称：</label>
								<div class="col-sm-4">
									<input class="form-control" type="text" id="appName" name="appName" placeholder="app名称"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-4 control-label ">所属服务(仅展示用,可不填)：</label>
								<div class="col-sm-4">
									<input class="form-control" type="text" id="service" name="service" placeholder="服务名称"/>
								</div>
							</div>
							<div class="form-group">
								<div class="form-control-static col-sm-offset-1">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
				
				<div class="title-alt">
                    <h6>关联app</h6>
                    <div class="titleToggle">
                        <a class="nav-toggle-alt" href="#element2">
                            <span class="entypo-up-open"></span>
                        </a>
                    </div>
                </div>
				
				<div class="body-nest" id="element2">
					<div class="panel-body">
						<form  class="form-horizontal m" id="user-app-association">
							<div class="form-group">
								<label class="col-sm-4 control-label ">选择关联的APP:</label>
								<div class="col-sm-4">
									<select name="apps" id="apps" class="form-control">
									</select>
								</div>
							</div>
							<div class="form-group">
								<div class="form-control-static col-sm-offset-1">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">
   
</div>
<!-- 弹窗 -->
<script  th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
<!-- 遮罩层 -->
<script  th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>
<!-- 自定义 js -->
<script th:src="@{/static/admin/common/js/userapp-add.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/common/js/userapp-association.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>

<!-- 加载下拉框数据 -->
<script>
	$(function(){
		getConfigInfo();
	})

	function getConfigInfo() {
		$.ajax({
			cache : true,
			type : "GET",
			url : "/app/canRelate",
			async : false,
			error : function(XMLHttpRequest){
				$.modal.alertError(XMLHttpRequest.responseJSON.msg);
			},
			success : function(data) {
				$("#apps").append("<option value=''>请选择</option>");
				for (var i = 0; i < data.length; i++) {
					var appName = data[i];
					$("#apps").append("<option value='"+appName+"'>" + appName + "</option>");
				}
			}
		});
	}
</script>
</body>

</html>
